package ruc.DolphinDB;

import com.xxdb.DBConnection;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DolphinDB_Common {
    public static DBConnection getDBConnection(String IP, int port) throws IOException {
        DBConnection db = new DBConnection();
        db.connect(IP, port);
        return db;
    }

    public static String DataUtil(long timeStamp) {
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");

        return sdf.format(new Date(Long.parseLong(String.valueOf(timeStamp))));
    }
}
